package arm.data;

import kha.graphics4.TextureFormat;
import kha.Blob;
import kha.Image;
import iron.data.Data;
import iron.system.ArmPack;

class ConstData {

	public static var font_x0 = [1,2,6,10,18,25,34,42,45,50,55,61,68,71,75,79,85,92,97,104,111,118,1,8,15,22,29,32,35,41,48,55,61,72,81,89,97,105,112,119,1,9,13,20,28,35,45,53,61,69,77,85,93,101,109,1,12,20,28,36,40,46,50,56,62,66,73,80,87,94,101,106,113,120,123,1,8,11,21,28,35,42,49,54,61,66,73,80,90,97,104,111,116,119,1];
	public static var font_y0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,62];
	public static var font_x1 = [1,5,9,17,24,33,41,44,49,54,60,67,70,74,78,84,91,96,103,110,117,124,7,14,21,28,31,34,40,47,54,60,71,80,88,96,104,111,118,126,8,12,19,27,34,44,52,60,68,76,84,92,100,108,116,11,19,27,35,39,45,49,55,61,65,72,79,86,93,100,105,112,119,122,126,7,10,20,27,34,41,48,53,60,65,72,79,89,96,103,110,115,118,123,8];
	public static var font_y1 = [1,10,5,9,13,11,10,5,13,13,6,8,5,3,4,10,10,9,9,10,9,10,23,22,23,23,21,22,19,18,19,23,25,22,22,23,22,22,22,23,34,34,35,34,34,34,34,35,34,36,34,35,34,35,34,45,45,45,45,49,46,49,42,38,40,44,47,44,47,44,46,46,46,45,48,59,59,56,56,57,59,59,56,57,59,57,56,56,56,59,56,61,60,61,65];
	public static var font_xoff = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
	public static var font_yoff = [10,2,1,2,0,1,2,1,1,1,2,3,8,6,8,2,2,2,2,2,2,2,2,2,2,2,4,4,4,4,4,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,10,1,4,1,4,1,4,1,4,1,2,2,1,1,4,4,4,4,4,4,4,2,4,4,4,4,4,4,1,2,1,5];
	public static var font_xadvance = [2.74625,2.85458,3.54791,6.83041,6.22916,8.125,6.89541,1.93375,3.79166,3.85666,4.7775,6.28875,2.1775,3.06041,2.91958,4.57166,6.22916,6.22916,6.22916,6.22916,6.22916,6.22916,6.22916,6.22916,6.22916,6.22916,2.68666,2.34541,5.63875,6.08833,5.79583,5.23791,9.96125,7.23666,6.90625,7.22041,7.27458,6.305,6.13166,7.55625,7.9083,3.01708,6.12083,6.955,5.96916,9.685,7.90833,7.62666,6.99833,7.62666,6.83041,6.58125,6.61916,7.19333,7.05791,9.84208,6.955,6.6625,6.64083,2.94125,4.55,2.94125,4.63666,5.005,3.42875,6.03416,6.22375,5.80666,6.25625,5.87708,3.85125,6.22375,6.11,2.69208,2.64875,5.6225,2.69208,9.72291,6.12083,6.32666,6.22375,6.305,3.75375,5.72,3.62375,6.11541,5.37333,8.33625,5.49791,5.24875,5.49791,3.75375,2.70291,3.75375,7.54541];

	#if arm_ltc
	public static var ltcMatTex: Image = null;
	public static var ltcMagTex: Image = null;
	public static function initLTC() {
		// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines
		// https://eheitzresearch.wordpress.com/415-2/
		Data.getBlob("ltc_mat.arm", function(ltc_mat:Blob) {
			Data.getBlob("ltc_mag.arm", function(ltc_mag:Blob) {
				ltcMatTex = Image.fromBytes(ArmPack.decode(ltc_mat.toBytes()), 64, 64, TextureFormat.RGBA128);
				ltcMagTex = Image.fromBytes(ArmPack.decode(ltc_mag.toBytes()), 64, 64, TextureFormat.A32);
			});
		});
	}
	#end
}
